package com.ktwlsoft.archivemanage.domain.business.repositoryService.businessInspect;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.entity.businessInspect.InspectSubjectItem;
import com.ktwlsoft.archivemanage.domain.dao.entity.businessInspect.SelfInspectSubjectItem;
import com.ktwlsoft.archivemanage.domain.dao.repository.businessInspect.IInspectSubjectItemMapper;
import com.ktwlsoft.archivemanage.domain.dao.repository.businessInspect.SelfInspectSubjectItemMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * self_inspect_subject_item--自查--业务指导题目选项-业务层实现类
 *
 * @author zhuhe
 * @date 2023/06/25
 */
@Service
public class SelfInspectSubjectItemRepositoryService extends ServiceImpl<SelfInspectSubjectItemMapper, SelfInspectSubjectItem> {

    /**
     * 查询分页 on 2019-11-12 15:00:46
     * @param pn 第几页
     * @param pageSize 每页多少条
     * @param inspectSubjectItem inspectSubjectItem
     * @return PageInfo<InspectSubjectItem>
     */
    public PageInfo<SelfInspectSubjectItem> findPage(int pn, int pageSize, SelfInspectSubjectItem inspectSubjectItem) {
        PageHelper.startPage(pn,pageSize);
        PageInfo<SelfInspectSubjectItem> pageInfo = new PageInfo<SelfInspectSubjectItem>(getBaseMapper().findList(inspectSubjectItem));
        return pageInfo;
    }

    /**
     * 查询集合 on 2019-11-12 15:00:46
     * @param inspectSubjectItem inspectSubjectItem
     * @return List<InspectSubjectItem>
     */
    public List<SelfInspectSubjectItem> findList(SelfInspectSubjectItem inspectSubjectItem) {
        return getBaseMapper().findList(inspectSubjectItem);
    }

    /**
     * 根据ID查询信息 on 2019-11-12 15:00:46
     * @param id	主键
     * @return InspectSubjectItem
     */
    public SelfInspectSubjectItem getById(Long id){
        return getBaseMapper().getById(id);
    }

    /**
     * 根据题目ID查询信息 on 2019-11-12 15:00:46
     * @param subjectId	题目ID
     * @return InspectSubjectItem
     */
    public List<SelfInspectSubjectItem> getBySubjectId(Long subjectId){
        return getBaseMapper().getBySubjectId(subjectId);
    }

    /**
     * 新增 on 2019-11-12 15:00:46
     * @param inspectSubjectItem inspectSubjectItem
     * @return int
     */
    public int insert(SelfInspectSubjectItem inspectSubjectItem){
        return getBaseMapper().insert(inspectSubjectItem);
    }

    /**
     * 批量插入 on 2019-04-23 10:57:02
     * @param list list
     * @return int
     */
    public int manyInsert(List<SelfInspectSubjectItem> list){
        return getBaseMapper().manyInsert(list);
    }

    /**
     * 修改 on 2019-11-12 15:00:46
     * @param inspectSubjectItem inspectSubjectItem
     * @return int
     */
    public int update(SelfInspectSubjectItem inspectSubjectItem){
        return getBaseMapper().update(inspectSubjectItem);
    }

    /**
     * 根据id集合批量删除信息 on 2019-11-12 15:00:46
     * @param guidanceSubjectItemArr	主键编号集合
     * @return int
     */
    public int deleteByIds(List<Long> guidanceSubjectItemArr){
        return getBaseMapper().deleteByIds(guidanceSubjectItemArr);
    }

    /**
     * 根据id删除信息 on 2019-11-12 15:00:46
     * @param id id
     * @return int
     */
    public int deleteById(Long id){
        return getBaseMapper().deleteById(id);
    }
}